import os
path = str(input('请输入目录'))
os.chdir(path)
a = os.listdir()
c = str(a)
b = []
lentgh = len(a)
count1=0
for i in range(lentgh):
    (x,y)=os.path.splitext(a[i])
    if y not in b:
        b.append(y)
    if y == '':
        count1+=1
for j in b:
    if j != '':
        print('该文件下共有类型为【%s】的文件有 %d个' %(j,c.count(j)))
    else :
        print('该文件下共有类型为【文件夹】的文件有 %d个' %(count1))
